import 'package:flutter/material.dart';

import 'num_ext.dart';
import 'size_fit.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    SizeFit.initialize();
    return MaterialApp(title: "美食App", home: MyHomePage());
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final size = MediaQuery.of(context).size;
    print("屏幕 size ${size.width} ${size.height}");
    final padding = MediaQuery.of(context).padding;

    /// 状态栏的高度
    print("状态栏的高度 ${padding.top}");

    print("屏幕物理 高度：${SizeFit.physicalHeight} 宽度：${SizeFit.physicalWidth}");
    return Scaffold(
      appBar: AppBar(title: Text("Theme")),
      body: MyContent(),
    );
  }
}

class MyContent extends StatelessWidget {
  const MyContent({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child:
          Container(color: Colors.green, height: 600.0.rpx, width: 600.rpx, child: Text("1222334")),
    );
  }
}
